home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-36 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  47.7 KB  |  1,116 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: I18N Level 3,  Next: I18N Level 4,  Prev: I18N Levels 1 and 2,  Up: Internationalization
  46.  
  47. I18N Level 3
  48. ============
  49.  
  50. * Menu:
  51.  
  52. * Level 3 Basics::
  53. * Level 3 Primitives::
  54. * Dynamic Messaging::
  55. * Domain Specification::
  56. * Documentation String Extraction::
  57.  
  58. 
  59. File: lispref.info,  Node: Level 3 Basics,  Next: Level 3 Primitives,  Up: I18N Level 3
  60.  
  61. Level 3 Basics
  62. --------------
  63.  
  64.    XEmacs now provides alpha-level functionality for I18N Level 3.
  65. This means that everything necessary for full messaging is available,
  66. but not every file has been converted.
  67.  
  68.    The two message files which have been created are `src/emacs.po' and
  69. `lisp/packages/mh-e.po'.  Both files need to be converted using
  70. `msgfmt', and the resulting `.mo' files placed in some locale's
  71. `LC_MESSAGES' directory.  The test "translations" in these files are
  72. the original messages prefixed by `TRNSLT_'.
  73.  
  74.    The domain for a variable is stored on the variable's property list
  75. under the property name VARIABLE-DOMAIN.  The function
  76. `documentation-property' uses this information when translating a
  77. variable's documentation.
  78.  
  79. 
  80. File: lispref.info,  Node: Level 3 Primitives,  Next: Dynamic Messaging,  Prev: Level 3 Basics,  Up: I18N Level 3
  81.  
  82. Level 3 Primitives
  83. ------------------
  84.  
  85.  - Function: gettext STRING
  86.      This function looks up STRING in the default message domain and
  87.      returns its translation.  If `I18N3' was not enabled when XEmacs
  88.      was compiled, it just returns STRING.
  89.  
  90.  - Function: dgettext DOMAIN STRING
  91.      This function looks up STRING in the specified message domain and
  92.      returns its translation.  If `I18N3' was not enabled when XEmacs
  93.      was compiled, it just returns STRING.
  94.  
  95.  - Function: bind-text-domain DOMAIN PATHNAME
  96.      This function associates a pathname with a message domain.  Here's
  97.      how the path to message file is constructed under SunOS 5.x:
  98.  
  99.           `{pathname}/{LANG}/LC_MESSAGES/{domain}.mo'
  100.  
  101.      If `I18N3' was not enabled when XEmacs was compiled, this function
  102.      does nothing.
  103.  
  104.  - Special Form: domain STRING
  105.      This function specifies the text domain used for translating
  106.      documentation strings and interactive prompts of a function.  For
  107.      example, write:
  108.  
  109.           (defun foo (arg) "Doc string" (domain "emacs-foo") ...)
  110.  
  111.      to specify `emacs-foo' as the text domain of the function `foo'.
  112.      The "call" to `domain' is actually a declaration rather than a
  113.      function; when actually called, `domain' just returns `nil'
  114.  
  115.  - Function: domain-of FUNCTION
  116.      This function returns the text domain of FUNCTION; it returns
  117.      `nil' if it is the default domain.  If `I18N3' was not enabled
  118.      when XEmacs was compiled, it always returns `nil'.
  119.  
  120. 
  121. File: lispref.info,  Node: Dynamic Messaging,  Next: Domain Specification,  Prev: Level 3 Primitives,  Up: I18N Level 3
  122.  
  123. Dynamic Messaging
  124. -----------------
  125.  
  126.    The `format' function has been extended to permit you to change the
  127. order of parameter insertion.  For example, the conversion format
  128. `%1$s' inserts parameter one as a string, while `%2$s' inserts
  129. parameter two.  This is useful when creating translations which require
  130. you to change the word order.
  131.  
  132. 
  133. File: lispref.info,  Node: Domain Specification,  Next: Documentation String Extraction,  Prev: Dynamic Messaging,  Up: I18N Level 3
  134.  
  135. Domain Specification
  136. --------------------
  137.  
  138.    The default message domain of XEmacs is `emacs'.  For add-on
  139. packages, it is best to use a different domain.  For example, let us
  140. say we want to convert the "gorilla" package to use the domain
  141. `emacs-gorilla'.  To translate the message "What gorilla?", use
  142. `dgettext' as follows:
  143.  
  144.      (dgettext "emacs-gorilla" "What gorilla?")
  145.  
  146.    A function (or macro) which has a documentation string or an
  147. interactive prompt needs to be associated with the domain in order for
  148. the documentation or prompt to be translated.  This is done with the
  149. `domain' special form as follows:
  150.  
  151.      (defun scratch (location)
  152.        "Scratch the specified location."
  153.        (domain "emacs-gorilla")
  154.        (interactive "sScratch: ")
  155.        ... )
  156.  
  157.    It is most efficient to specify the domain in the first line of of
  158. the function body, before the `interactive' form.
  159.  
  160.    For variables and constants which have documentation strings,
  161. specify the domain after the documentation.
  162.  
  163.  - Special Form: defvar SYMBOL [VALUE [DOC-STRING [DOMAIN]]]
  164.      Example:
  165.           (defvar weight 250 "Weight of gorilla, in pounds." "emacs-gorilla")
  166.  
  167.  - Special Form: defconst SYMBOL [VALUE [DOC-STRING [DOMAIN]]]
  168.      Example:
  169.           (defconst limbs 4 "Number of limbs" "emacs-gorilla")
  170.  
  171.    Autoloaded functions which are specified in `loaddefs.el' do not need
  172. to have a domain specification, because their documentation strings are
  173. extracted into the main message base.  However, for autoloaded functions
  174. which are specified in a separate package, use following syntax:
  175.  
  176.  - Function: autoload SYMBOL FILENAME &optional DOCSTRING INTERACTIVE
  177.           MACRO DOMAIN
  178.      Example:
  179.           (autoload 'explore "jungle" "Explore the jungle." nil nil "emacs-gorilla")
  180.  
  181. 
  182. File: lispref.info,  Node: Documentation String Extraction,  Prev: Domain Specification,  Up: I18N Level 3
  183.  
  184. Documentation String Extraction
  185. -------------------------------
  186.  
  187.    The utility `etc/make-po' scans the file `DOC' to extract
  188. documentation strings and creates a message file `doc.po'.  This file
  189. may then be inserted within `emacs.po'.
  190.  
  191.    Currently, `make-po' is hard-coded to read from `DOC' and write to
  192. `doc.po'.  In order to extract documentation strings from an add-on
  193. package, first run `make-docfile' on the package to produce the `DOC'
  194. file.  Then run `make-po -p' with the `-p' argument to indicate that we
  195. are extracting documentation for an add-on package.
  196.  
  197.    (The `-p' argument is a kludge to make up for a subtle difference
  198. between pre-loaded documentation and add-on documentation:  For add-on
  199. packages, the final carriage returns in the strings produced by
  200. `make-docfile' must be ignored.)
  201.  
  202. 
  203. File: lispref.info,  Node: I18N Level 4,  Prev: I18N Level 3,  Up: Internationalization
  204.  
  205. I18N Level 4
  206. ============
  207.  
  208.    Not yet documented.
  209.  
  210. 
  211. File: lispref.info,  Node: Tips,  Next: XEmacs Internals,  Prev: Internationalization,  Up: Top
  212.  
  213. Tips and Standards
  214. ******************
  215.  
  216.    This chapter describes no additional features of Emacs Lisp.
  217. Instead it gives advice on making effective use of the features
  218. described in the previous chapters.
  219.  
  220. * Menu:
  221.  
  222. * Style Tips::                Writing clean and robust programs.
  223. * Compilation Tips::          Making compiled code run fast.
  224. * Documentation Tips::        Writing readable documentation strings.
  225. * Comment Tips::          Conventions for writing comments.
  226. * Library Headers::           Standard headers for library packages.
  227.  
  228. 
  229. File: lispref.info,  Node: Style Tips,  Next: Compilation Tips,  Up: Tips
  230.  
  231. Writing Clean Lisp Programs
  232. ===========================
  233.  
  234.    Here are some tips for avoiding common errors in writing Lisp code
  235. intended for widespread use:
  236.  
  237.    * Since all global variables share the same name space, and all
  238.      functions share another name space, you should choose a short word
  239.      to distinguish your program from other Lisp programs.  Then take
  240.      care to begin the names of all global variables, constants, and
  241.      functions with the chosen prefix.  This helps avoid name conflicts.
  242.  
  243.      This recommendation applies even to names for traditional Lisp
  244.      primitives that are not primitives in Emacs Lisp--even to `cadr'.
  245.      Believe it or not, there is more than one plausible way to define
  246.      `cadr'.  Play it safe; append your name prefix to produce a name
  247.      like `foo-cadr' or `mylib-cadr' instead.
  248.  
  249.      If you write a function that you think ought to be added to Emacs
  250.      under a certain name, such as `twiddle-files', don't call it by
  251.      that name in your program.  Call it `mylib-twiddle-files' in your
  252.      program, and send mail to `bug-gnu-emacs@prep.ai.mit.edu'
  253.      suggesting we add it to Emacs.  If and when we do, we can change
  254.      the name easily enough.
  255.  
  256.      If one prefix is insufficient, your package may use two or three
  257.      alternative common prefixes, so long as they make sense.
  258.  
  259.      Separate the prefix from the rest of the symbol name with a hyphen,
  260.      `-'.  This will be consistent with XEmacs itself and with most
  261.      Emacs Lisp programs.
  262.  
  263.    * It is often useful to put a call to `provide' in each separate
  264.      library program, at least if there is more than one entry point to
  265.      the program.
  266.  
  267.    * If a file requires certain other library programs to be loaded
  268.      beforehand, then the comments at the beginning of the file should
  269.      say so.  Also, use `require' to make sure they are loaded.
  270.  
  271.    * If one file FOO uses a macro defined in another file BAR, FOO
  272.      should contain this expression before the first use of the macro:
  273.  
  274.           (eval-when-compile (require 'BAR))
  275.  
  276.      (And BAR should contain `(provide 'BAR)', to make the `require'
  277.      work.)  This will cause BAR to be loaded when you byte-compile
  278.      FOO.  Otherwise, you risk compiling FOO without the necessary
  279.      macro loaded, and that would produce compiled code that won't work
  280.      right.  *Note Compiling Macros::.
  281.  
  282.      Using `eval-when-compile' avoids loading BAR when the compiled
  283.      version of FOO is *used*.
  284.  
  285.    * If you define a major mode, make sure to run a hook variable using
  286.      `run-hooks', just as the existing major modes do.  *Note Hooks::.
  287.  
  288.    * If the purpose of a function is to tell you whether a certain
  289.      condition is true or false, give the function a name that ends in
  290.      `p'.  If the name is one word, add just `p'; if the name is
  291.      multiple words, add `-p'.  Examples are `framep' and
  292.      `frame-live-p'.
  293.  
  294.    * If a user option variable records a true-or-false condition, give
  295.      it a name that ends in `-flag'.
  296.  
  297.    * Please do not define `C-c LETTER' as a key in your major modes.
  298.      These sequences are reserved for users; they are the *only*
  299.      sequences reserved for users, so we cannot do without them.
  300.  
  301.      Instead, define sequences consisting of `C-c' followed by a
  302.      non-letter.  These sequences are reserved for major modes.
  303.  
  304.      Changing all the major modes in Emacs 18 so they would follow this
  305.      convention was a lot of work.  Abandoning this convention would
  306.      make that work go to waste, and inconvenience users.
  307.  
  308.    * Sequences consisting of `C-c' followed by `{', `}', `<', `>', `:'
  309.      or `;' are also reserved for major modes.
  310.  
  311.    * Sequences consisting of `C-c' followed by any other punctuation
  312.      character are allocated for minor modes.  Using them in a major
  313.      mode is not absolutely prohibited, but if you do that, the major
  314.      mode binding may be shadowed from time to time by minor modes.
  315.  
  316.    * You should not bind `C-h' following any prefix character (including
  317.      `C-c').  If you don't bind `C-h', it is automatically available as
  318.      a help character for listing the subcommands of the prefix
  319.      character.
  320.  
  321.    * You should not bind a key sequence ending in ESC except following
  322.      another ESC.  (That is, it is ok to bind a sequence ending in `ESC
  323.      ESC'.)
  324.  
  325.      The reason for this rule is that a non-prefix binding for ESC in
  326.      any context prevents recognition of escape sequences as function
  327.      keys in that context.
  328.  
  329.    * Applications should not bind mouse events based on button 1 with
  330.      the shift key held down.  These events include `S-mouse-1',
  331.      `M-S-mouse-1', `C-S-mouse-1', and so on.  They are reserved for
  332.      users.
  333.  
  334.    * Modes should redefine `mouse-2' as a command to follow some sort of
  335.      reference in the text of a buffer, if users usually would not want
  336.      to alter the text in that buffer by hand.  Modes such as Dired,
  337.      Info, Compilation, and Occur redefine it in this way.
  338.  
  339.    * When a package provides a modification of ordinary Emacs behavior,
  340.      it is good to include a command to enable and disable the feature,
  341.      Provide a command named `WHATEVER-mode' which turns the feature on
  342.      or off, and make it autoload (*note Autoload::.).  Design the
  343.      package so that simply loading it has no visible effect--that
  344.      should not enable the feature.  Users will request the feature by
  345.      invoking the command.
  346.  
  347.    * It is a bad idea to define aliases for the Emacs primitives.  Use
  348.      the standard names instead.
  349.  
  350.    * Redefining an Emacs primitive is an even worse idea.  It may do
  351.      the right thing for a particular program, but there is no telling
  352.      what other programs might break as a result.
  353.  
  354.    * If a file does replace any of the functions or library programs of
  355.      standard XEmacs, prominent comments at the beginning of the file
  356.      should say which functions are replaced, and how the behavior of
  357.      the replacements differs from that of the originals.
  358.  
  359.    * Please keep the names of your Emacs Lisp source files to 13
  360.      characters or less.  This way, if the files are compiled, the
  361.      compiled files' names will be 14 characters or less, which is
  362.      short enough to fit on all kinds of Unix systems.
  363.  
  364.    * Don't use `next-line' or `previous-line' in programs; nearly
  365.      always, `forward-line' is more convenient as well as more
  366.      predictable and robust.  *Note Text Lines::.
  367.  
  368.    * Don't call functions that set the mark, unless setting the mark is
  369.      one of the intended features of your program.  The mark is a
  370.      user-level feature, so it is incorrect to change the mark except
  371.      to supply a value for the user's benefit.  *Note The Mark::.
  372.  
  373.      In particular, don't use these functions:
  374.  
  375.         * `beginning-of-buffer', `end-of-buffer'
  376.  
  377.         * `replace-string', `replace-regexp'
  378.  
  379.      If you just want to move point, or replace a certain string,
  380.      without any of the other features intended for interactive users,
  381.      you can replace these functions with one or two lines of simple
  382.      Lisp code.
  383.  
  384.    * Use lists rather than vectors, except when there is a particular
  385.      reason to use a vector.  Lisp has more facilities for manipulating
  386.      lists than for vectors, and working with lists is usually more
  387.      convenient.
  388.  
  389.      Vectors are advantageous for tables that are substantial in size
  390.      and are accessed in random order (not searched front to back),
  391.      provided there is no need to insert or delete elements (only lists
  392.      allow that).
  393.  
  394.    * The recommended way to print a message in the echo area is with
  395.      the `message' function, not `princ'.  *Note The Echo Area::.
  396.  
  397.    * When you encounter an error condition, call the function `error'
  398.      (or `signal').  The function `error' does not return.  *Note
  399.      Signaling Errors::.
  400.  
  401.      Do not use `message', `throw', `sleep-for', or `beep' to report
  402.      errors.
  403.  
  404.    * An error message should start with a capital letter but should not
  405.      end with a period.
  406.  
  407.    * Try to avoid using recursive edits.  Instead, do what the Rmail `e'
  408.      command does: use a new local keymap that contains one command
  409.      defined to switch back to the old local keymap.  Or do what the
  410.      `edit-options' command does: switch to another buffer and let the
  411.      user switch back at will.  *Note Recursive Editing::.
  412.  
  413.    * In some other systems there is a convention of choosing variable
  414.      names that begin and end with `*'.  We don't use that convention
  415.      in Emacs Lisp, so please don't use it in your programs.  (Emacs
  416.      uses such names only for program-generated buffers.)  The users
  417.      will find Emacs more coherent if all libraries use the same
  418.      conventions.
  419.  
  420.    * Indent each function with `C-M-q' (`indent-sexp') using the
  421.      default indentation parameters.
  422.  
  423.    * Don't make a habit of putting close-parentheses on lines by
  424.      themselves; Lisp programmers find this disconcerting.  Once in a
  425.      while, when there is a sequence of many consecutive
  426.      close-parentheses, it may make sense to split them in one or two
  427.      significant places.
  428.  
  429.    * Please put a copyright notice on the file if you give copies to
  430.      anyone.  Use the same lines that appear at the top of the Lisp
  431.      files in XEmacs itself.  If you have not signed papers to assign
  432.      the copyright to the Foundation, then place your name in the
  433.      copyright notice in place of the Foundation's name.
  434.  
  435. 
  436. File: lispref.info,  Node: Compilation Tips,  Next: Documentation Tips,  Prev: Style Tips,  Up: Tips
  437.  
  438. Tips for Making Compiled Code Fast
  439. ==================================
  440.  
  441.    Here are ways of improving the execution speed of byte-compiled Lisp
  442. programs.
  443.  
  444.    * Use the `profile' library to profile your program.  See the file
  445.      `profile.el' for instructions.
  446.  
  447.    * Use iteration rather than recursion whenever possible.  Function
  448.      calls are slow in Emacs Lisp even when a compiled function is
  449.      calling another compiled function.
  450.  
  451.    * Using the primitive list-searching functions `memq', `member',
  452.      `assq', or `assoc' is even faster than explicit iteration.  It may
  453.      be worth rearranging a data structure so that one of these
  454.      primitive search functions can be used.
  455.  
  456.    * Certain built-in functions are handled specially in byte-compiled
  457.      code, avoiding the need for an ordinary function call.  It is a
  458.      good idea to use these functions rather than alternatives.  To see
  459.      whether a function is handled specially by the compiler, examine
  460.      its `byte-compile' property.  If the property is non-`nil', then
  461.      the function is handled specially.
  462.  
  463.      For example, the following input will show you that `aref' is
  464.      compiled specially (*note Array Functions::.) while `elt' is not
  465.      (*note Sequence Functions::.):
  466.  
  467.           (get 'aref 'byte-compile)
  468.                => byte-compile-two-args
  469.           
  470.           (get 'elt 'byte-compile)
  471.                => nil
  472.  
  473.    * If calling a small function accounts for a  substantial part of
  474.      your program's running time, make the function inline.  This
  475.      eliminates the function call overhead.  Since making a function
  476.      inline reduces the flexibility of changing the program, don't do
  477.      it unless it gives a noticeable speedup in something slow enough
  478.      that users care about the speed.  *Note Inline Functions::.
  479.  
  480. 
  481. File: lispref.info,  Node: Documentation Tips,  Next: Comment Tips,  Prev: Compilation Tips,  Up: Tips
  482.  
  483. Tips for Documentation Strings
  484. ==============================
  485.  
  486.    Here are some tips for the writing of documentation strings.
  487.  
  488.    * Every command, function, or variable intended for users to know
  489.      about should have a documentation string.
  490.  
  491.    * An internal variable or subroutine of a Lisp program might as well
  492.      have a documentation string.  In earlier Emacs versions, you could
  493.      save space by using a comment instead of a documentation string,
  494.      but that is no longer the case.
  495.  
  496.    * The first line of the documentation string should consist of one
  497.      or two complete sentences that stand on their own as a summary.
  498.      `M-x apropos' displays just the first line, and if it doesn't
  499.      stand on its own, the result looks bad.  In particular, start the
  500.      first line with a capital letter and end with a period.
  501.  
  502.      The documentation string can have additional lines that expand on
  503.      the details of how to use the function or variable.  The
  504.      additional lines should be made up of complete sentences also, but
  505.      they may be filled if that looks good.
  506.  
  507.    * For consistency, phrase the verb in the first sentence of a
  508.      documentation string as an infinitive with "to" omitted.  For
  509.      instance, use "Return the cons of A and B." in preference to
  510.      "Returns the cons of A and B."  Usually it looks good to do
  511.      likewise for the rest of the first paragraph.  Subsequent
  512.      paragraphs usually look better if they have proper subjects.
  513.  
  514.    * Write documentation strings in the active voice, not the passive,
  515.      and in the present tense, not the future.  For instance, use
  516.      "Return a list containing A and B." instead of "A list containing
  517.      A and B will be returned."
  518.  
  519.    * Avoid using the word "cause" (or its equivalents) unnecessarily.
  520.      Instead of, "Cause Emacs to display text in boldface," write just
  521.      "Display text in boldface."
  522.  
  523.    * Do not start or end a documentation string with whitespace.
  524.  
  525.    * Format the documentation string so that it fits in an Emacs window
  526.      on an 80-column screen.  It is a good idea for most lines to be no
  527.      wider than 60 characters.  The first line can be wider if
  528.      necessary to fit the information that ought to be there.
  529.  
  530.      However, rather than simply filling the entire documentation
  531.      string, you can make it much more readable by choosing line breaks
  532.      with care.  Use blank lines between topics if the documentation
  533.      string is long.
  534.  
  535.    * *Do not* indent subsequent lines of a documentation string so that
  536.      the text is lined up in the source code with the text of the first
  537.      line.  This looks nice in the source code, but looks bizarre when
  538.      users view the documentation.  Remember that the indentation
  539.      before the starting double-quote is not part of the string!
  540.  
  541.    * A variable's documentation string should start with `*' if the
  542.      variable is one that users would often want to set interactively.
  543.      If the value is a long list, or a function, or if the variable
  544.      would be set only in init files, then don't start the
  545.      documentation string with `*'.  *Note Defining Variables::.
  546.  
  547.    * The documentation string for a variable that is a yes-or-no flag
  548.      should start with words such as "Non-nil means...", to make it
  549.      clear that all non-`nil' values are equivalent and indicate
  550.      explicitly what `nil' and non-`nil' mean.
  551.  
  552.    * When a function's documentation string mentions the value of an
  553.      argument of the function, use the argument name in capital letters
  554.      as if it were a name for that value.  Thus, the documentation
  555.      string of the function `/' refers to its second argument as
  556.      `DIVISOR', because the actual argument name is `divisor'.
  557.  
  558.      Also use all caps for meta-syntactic variables, such as when you
  559.      show the decomposition of a list or vector into subunits, some of
  560.      which may vary.
  561.  
  562.    *  When a documentation string refers to a Lisp symbol, write it as
  563.      it would be printed (which usually means in lower case), with
  564.      single-quotes around it.  For example: `lambda'.  There are two
  565.      exceptions: write t and nil without single-quotes.  (In this
  566.      manual, we normally do use single-quotes for those symbols.)
  567.  
  568.    * Don't write key sequences directly in documentation strings.
  569.      Instead, use the `\\[...]' construct to stand for them.  For
  570.      example, instead of writing `C-f', write `\\[forward-char]'.  When
  571.      Emacs displays the documentation string, it substitutes whatever
  572.      key is currently bound to `forward-char'.  (This is normally `C-f',
  573.      but it may be some other character if the user has moved key
  574.      bindings.) *Note Keys in Documentation::.
  575.  
  576.    * In documentation strings for a major mode, you will want to refer
  577.      to the key bindings of that mode's local map, rather than global
  578.      ones.  Therefore, use the construct `\\<...>' once in the
  579.      documentation string to specify which key map to use.  Do this
  580.      before the first use of `\\[...]'.  The text inside the `\\<...>'
  581.      should be the name of the variable containing the local keymap for
  582.      the major mode.
  583.  
  584.      It is not practical to use `\\[...]' very many times, because
  585.      display of the documentation string will become slow.  So use this
  586.      to describe the most important commands in your major mode, and
  587.      then use `\\{...}' to display the rest of the mode's keymap.
  588.  
  589. 
  590. File: lispref.info,  Node: Comment Tips,  Next: Library Headers,  Prev: Documentation Tips,  Up: Tips
  591.  
  592. Tips on Writing Comments
  593. ========================
  594.  
  595.    We recommend these conventions for where to put comments and how to
  596. indent them:
  597.  
  598. `;'
  599.      Comments that start with a single semicolon, `;', should all be
  600.      aligned to the same column on the right of the source code.  Such
  601.      comments usually explain how the code on the same line does its
  602.      job.  In Lisp mode and related modes, the `M-;'
  603.      (`indent-for-comment') command automatically inserts such a `;' in
  604.      the right place, or aligns such a comment if it is already present.
  605.  
  606.      This and following examples are taken from the Emacs sources.
  607.  
  608.           (setq base-version-list                 ; there was a base
  609.                 (assoc (substring fn 0 start-vn)  ; version to which
  610.                        file-version-assoc-list))  ; this looks like
  611.                                                   ; a subversion
  612.  
  613. `;;'
  614.      Comments that start with two semicolons, `;;', should be aligned to
  615.      the same level of indentation as the code.  Such comments usually
  616.      describe the purpose of the following lines or the state of the
  617.      program at that point.  For example:
  618.  
  619.           (prog1 (setq auto-fill-function
  620.                        ...
  621.                        ...
  622.             ;; update modeline
  623.             (redraw-modeline)))
  624.  
  625.      Every function that has no documentation string (because it is use
  626.      only internally within the package it belongs to), should have
  627.      instead a two-semicolon comment right before the function,
  628.      explaining what the function does and how to call it properly.
  629.      Explain precisely what each argument means and how the function
  630.      interprets its possible values.
  631.  
  632. `;;;'
  633.      Comments that start with three semicolons, `;;;', should start at
  634.      the left margin.  Such comments are used outside function
  635.      definitions to make general statements explaining the design
  636.      principles of the program.  For example:
  637.  
  638.           ;;; This Lisp code is run in XEmacs
  639.           ;;; when it is to operate as a server
  640.           ;;; for other processes.
  641.  
  642.      Another use for triple-semicolon comments is for commenting out
  643.      lines within a function.  We use triple-semicolons for this
  644.      precisely so that they remain at the left margin.
  645.  
  646.           (defun foo (a)
  647.           ;;; This is no longer necessary.
  648.           ;;;  (force-mode-line-update)
  649.             (message "Finished with %s" a))
  650.  
  651. `;;;;'
  652.      Comments that start with four semicolons, `;;;;', should be aligned
  653.      to the left margin and are used for headings of major sections of a
  654.      program.  For example:
  655.  
  656.           ;;;; The kill ring
  657.  
  658. The indentation commands of the Lisp modes in XEmacs, such as `M-;'
  659. (`indent-for-comment') and TAB (`lisp-indent-line') automatically
  660. indent comments according to these conventions, depending on the the
  661. number of semicolons.  *Note Manipulating Comments: (emacs)Comments.
  662.  
  663. 
  664. File: lispref.info,  Node: Library Headers,  Prev: Comment Tips,  Up: Tips
  665.  
  666. Conventional Headers for XEmacs Libraries
  667. =========================================
  668.  
  669.    XEmacs has conventions for using special comments in Lisp libraries
  670. to divide them into sections and give information such as who wrote
  671. them.  This section explains these conventions.  First, an example:
  672.  
  673.      ;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers
  674.      
  675.      ;; Copyright (C) 1992 Free Software Foundation, Inc.
  676.      
  677.      ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
  678.      ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com>
  679.      ;; Created: 14 Jul 1992
  680.      ;; Version: 1.2
  681.      ;; Keywords: docs
  682.      
  683.      ;; This file is part of XEmacs.
  684.      COPYING PERMISSIONS...
  685.  
  686.    The very first line should have this format:
  687.  
  688.      ;;; FILENAME --- DESCRIPTION
  689.  
  690. The description should be complete in one line.
  691.  
  692.    After the copyright notice come several "header comment" lines, each
  693. beginning with `;; HEADER-NAME:'.  Here is a table of the conventional
  694. possibilities for HEADER-NAME:
  695.  
  696. `Author'
  697.      This line states the name and net address of at least the principal
  698.      author of the library.
  699.  
  700.      If there are multiple authors, you can list them on continuation
  701.      lines led by `;;' and a tab character, like this:
  702.  
  703.           ;; Author: Ashwin Ram <Ram-Ashwin@cs.yale.edu>
  704.           ;;      Dave Sill <de5@ornl.gov>
  705.           ;;      Dave Brennan <brennan@hal.com>
  706.           ;;      Eric Raymond <esr@snark.thyrsus.com>
  707.  
  708. `Maintainer'
  709.      This line should contain a single name/address as in the Author
  710.      line, or an address only, or the string `FSF'.  If there is no
  711.      maintainer line, the person(s) in the Author field are presumed to
  712.      be the maintainers.  The example above is mildly bogus because the
  713.      maintainer line is redundant.
  714.  
  715.      The idea behind the `Author' and `Maintainer' lines is to make
  716.      possible a Lisp function to "send mail to the maintainer" without
  717.      having to mine the name out by hand.
  718.  
  719.      Be sure to surround the network address with `<...>' if you
  720.      include the person's full name as well as the network address.
  721.  
  722. `Created'
  723.      This optional line gives the original creation date of the file.
  724.      For historical interest only.
  725.  
  726. `Version'
  727.      If you wish to record version numbers for the individual Lisp
  728.      program, put them in this line.
  729.  
  730. `Adapted-By'
  731.      In this header line, place the name of the person who adapted the
  732.      library for installation (to make it fit the style conventions, for
  733.      example).
  734.  
  735. `Keywords'
  736.      This line lists keywords for the `finder-by-keyword' help command.
  737.      This field is important; it's how people will find your package
  738.      when they're looking for things by topic area.  To separate the
  739.      keywords, you can use spaces, commas, or both.
  740.  
  741.    Just about every Lisp library ought to have the `Author' and
  742. `Keywords' header comment lines.  Use the others if they are
  743. appropriate.  You can also put in header lines with other header
  744. names--they have no standard meanings, so they can't do any harm.
  745.  
  746.    We use additional stylized comments to subdivide the contents of the
  747. library file.  Here is a table of them:
  748.  
  749. `;;; Commentary:'
  750.      This begins introductory comments that explain how the library
  751.      works.  It should come right after the copying permissions.
  752.  
  753. `;;; Change log:'
  754.      This begins change log information stored in the library file (if
  755.      you store the change history there).  For most of the Lisp files
  756.      distributed with XEmacs, the change history is kept in the file
  757.      `ChangeLog' and not in the source file at all; these files do not
  758.      have a `;;; Change log:' line.
  759.  
  760. `;;; Code:'
  761.      This begins the actual code of the program.
  762.  
  763. `;;; FILENAME ends here'
  764.      This is the "footer line"; it appears at the very end of the file.
  765.      Its purpose is to enable people to detect truncated versions of
  766.      the file from the lack of a footer line.
  767.  
  768. 
  769. File: lispref.info,  Node: XEmacs Internals,  Next: Standard Errors,  Prev: Tips,  Up: Top
  770.  
  771. XEmacs Internals
  772. ****************
  773.  
  774.    This chapter describes how the runnable XEmacs executable is dumped
  775. with the preloaded Lisp libraries in it, how storage is allocated, and
  776. some internal aspects of XEmacs that may be of interest to C
  777. programmers.
  778.  
  779. * Menu:
  780.  
  781. * Building XEmacs::     How to preload Lisp libraries into XEmacs.
  782. * Pure Storage::        A kludge to make preloaded Lisp functions sharable.
  783. * Garbage Collection::  Reclaiming space for Lisp objects no longer used.
  784. * Writing XEmacs Primitives::   Writing C code for XEmacs.
  785. * Object Internals::    Data formats of buffers, windows, processes.
  786.  
  787. 
  788. File: lispref.info,  Node: Building XEmacs,  Next: Pure Storage,  Prev: XEmacs Internals,  Up: XEmacs Internals
  789.  
  790. Building XEmacs
  791. ===============
  792.  
  793.    This section explains the steps involved in building the XEmacs
  794. executable.  You don't have to know this material to build and install
  795. XEmacs, since the makefiles do all these things automatically.  This
  796. information is pertinent to XEmacs maintenance.
  797.  
  798.    Compilation of the C source files in the `src' directory produces an
  799. executable file called `temacs', also called a "bare impure XEmacs".
  800. It contains the Emacs Lisp interpreter and I/O routines, but not the
  801. editing commands.
  802.  
  803.    The command `temacs -l loadup' uses `temacs' to create the real
  804. runnable XEmacs executable.  These arguments direct `temacs' to
  805. evaluate the Lisp files specified in the file `loadup.el'.  These files
  806. set up the normal XEmacs editing environment, resulting in an XEmacs
  807. that is still impure but no longer bare.
  808.  
  809.    It takes a substantial time to load the standard Lisp files.
  810. Luckily, you don't have to do this each time you run XEmacs; `temacs'
  811. can dump out an executable program called `emacs' that has these files
  812. preloaded.  `emacs' starts more quickly because it does not need to
  813. load the files.  This is the XEmacs executable that is normally
  814. installed.
  815.  
  816.    To create `emacs', use the command `temacs -batch -l loadup dump'.
  817. The purpose of `-batch' here is to prevent `temacs' from trying to
  818. initialize any of its data on the terminal; this ensures that the
  819. tables of terminal information are empty in the dumped XEmacs.  The
  820. argument `dump' tells `loadup.el' to dump a new executable named
  821. `emacs'.
  822.  
  823.    Some operating systems don't support dumping.  On those systems, you
  824. must start XEmacs with the `temacs -l loadup' command each time you use
  825. it.  This takes a substantial time, but since you need to start Emacs
  826. once a day at most--or once a week if you never log out--the extra time
  827. is not too severe a problem.
  828.  
  829.    You can specify additional files to preload by writing a library
  830. named `site-load.el' that loads them.  You may need to increase the
  831. value of `PURESIZE', in `src/puresize.h', to make room for the
  832. additional files.  (Try adding increments of 20000 until it is big
  833. enough.)  However, the advantage of preloading additional files
  834. decreases as machines get faster.  On modern machines, it is usually not
  835. advisable.
  836.  
  837.    You can specify other Lisp expressions to execute just before dumping
  838. by putting them in a library named `site-init.el'.  However, if they
  839. might alter the behavior that users expect from an ordinary unmodified
  840. XEmacs, it is better to put them in `default.el', so that users can
  841. override them if they wish.  *Note Start-up Summary::.
  842.  
  843.    Before `loadup.el' dumps the new executable, it finds the
  844. documentation strings for primitive and preloaded functions (and
  845. variables) in the file where they are stored, by calling
  846. `Snarf-documentation' (*note Accessing Documentation::.).  These
  847. strings were moved out of the `emacs' executable to make it smaller.
  848. *Note Documentation Basics::.
  849.  
  850.  - Function: dump-emacs TO-FILE FROM-FILE
  851.      This function dumps the current state of XEmacs into an executable
  852.      file TO-FILE.  It takes symbols from FROM-FILE (this is normally
  853.      the executable file `temacs').
  854.  
  855.      If you use this function in an XEmacs that was already dumped, you
  856.      must set `command-line-processed' to `nil' first for good results.
  857.      *Note Command Line Arguments::.
  858.  
  859.  - Command: emacs-version
  860.      This function returns a string describing the version of XEmacs
  861.      that is running.  It is useful to include this string in bug
  862.      reports.
  863.  
  864.           (emacs-version)
  865.             => "XEmacs 19.13 of Mon Aug 21 1995 on willow
  866.                (usg-unix-v) [formerly Lucid Emacs]"
  867.  
  868.      Called interactively, the function prints the same information in
  869.      the echo area.
  870.  
  871.  - Variable: emacs-build-time
  872.      The value of this variable is the time at which XEmacs was built
  873.      at the local site.
  874.  
  875.           emacs-build-time
  876.                => "Tue Jun  6 14:55:57 1995"
  877.  
  878.  - Variable: emacs-version
  879.      The value of this variable is the version of Emacs being run.  It
  880.      is a string, e.g. `"19.13 XEmacs Lucid"'.
  881.  
  882.    The following two variables did not exist before Emacs version 19.23,
  883. which reduces their usefulness at present, but we hope they will be
  884. convenient in the future.
  885.  
  886.  - Variable: emacs-major-version
  887.      The major version number of Emacs, as an integer.  For XEmacs
  888.      version 19.13, the value is 19.
  889.  
  890.  - Variable: emacs-minor-version
  891.      The minor version number of Emacs, as an integer.  For XEmacs
  892.      version 19.13, the value is 13.
  893.  
  894. 
  895. File: lispref.info,  Node: Pure Storage,  Next: Garbage Collection,  Prev: Building XEmacs,  Up: XEmacs Internals
  896.  
  897. Pure Storage
  898. ============
  899.  
  900.    Emacs Lisp uses two kinds of storage for user-created Lisp objects:
  901. "normal storage" and "pure storage".  Normal storage is where all the
  902. new data created during an XEmacs session is kept; see the following
  903. section for information on normal storage.  Pure storage is used for
  904. certain data in the preloaded standard Lisp files--data that should
  905. never change during actual use of XEmacs.
  906.  
  907.    Pure storage is allocated only while `temacs' is loading the
  908. standard preloaded Lisp libraries.  In the file `emacs', it is marked
  909. as read-only (on operating systems that permit this), so that the
  910. memory space can be shared by all the XEmacs jobs running on the
  911. machine at once.  Pure storage is not expandable; a fixed amount is
  912. allocated when XEmacs is compiled, and if that is not sufficient for the
  913. preloaded libraries, `temacs' crashes.  If that happens, you must
  914. increase the compilation parameter `PURESIZE' in the file
  915. `src/puresize.h'.  This normally won't happen unless you try to preload
  916. additional libraries or add features to the standard ones.
  917.  
  918.  - Function: purecopy OBJECT
  919.      This function makes a copy of OBJECT in pure storage and returns
  920.      it.  It copies strings by simply making a new string with the same
  921.      characters in pure storage.  It recursively copies the contents of
  922.      vectors and cons cells.  It does not make copies of other objects
  923.      such as symbols, but just returns them unchanged.  It signals an
  924.      error if asked to copy markers.
  925.  
  926.      This function is a no-op except while XEmacs is being built and
  927.      dumped; it is usually called only in the file
  928.      `emacs/lisp/loaddefs.el', but a few packages call it just in case
  929.      you decide to preload them.
  930.  
  931.  - Variable: pure-bytes-used
  932.      The value of this variable is the number of bytes of pure storage
  933.      allocated so far.  Typically, in a dumped XEmacs, this number is
  934.      very close to the total amount of pure storage available--if it
  935.      were not, we would preallocate less.
  936.  
  937.  - Variable: purify-flag
  938.      This variable determines whether `defun' should make a copy of the
  939.      function definition in pure storage.  If it is non-`nil', then the
  940.      function definition is copied into pure storage.
  941.  
  942.      This flag is `t' while loading all of the basic functions for
  943.      building XEmacs initially (allowing those functions to be sharable
  944.      and non-collectible).  Dumping XEmacs as an executable always
  945.      writes `nil' in this variable, regardless of the value it actually
  946.      has before and after dumping.
  947.  
  948.      You should not change this flag in a running XEmacs.
  949.  
  950. 
  951. File: lispref.info,  Node: Garbage Collection,  Next: Writing XEmacs Primitives,  Prev: Pure Storage,  Up: XEmacs Internals
  952.  
  953. Garbage Collection
  954. ==================
  955.  
  956.    When a program creates a list or the user defines a new function
  957. (such as by loading a library), that data is placed in normal storage.
  958. If normal storage runs low, then XEmacs asks the operating system to
  959. allocate more memory in blocks of 1k bytes.  Each block is used for one
  960. type of Lisp object, so symbols, cons cells, markers, etc., are
  961. segregated in distinct blocks in memory.  (Vectors, long strings,
  962. buffers and certain other editing types, which are fairly large, are
  963. allocated in individual blocks, one per object, while small strings are
  964. packed into blocks of 8k bytes.)
  965.  
  966.    It is quite common to use some storage for a while, then release it
  967. by (for example) killing a buffer or deleting the last pointer to an
  968. object.  XEmacs provides a "garbage collector" to reclaim this
  969. abandoned storage.  (This name is traditional, but "garbage recycler"
  970. might be a more intuitive metaphor for this facility.)
  971.  
  972.    The garbage collector operates by finding and marking all Lisp
  973. objects that are still accessible to Lisp programs.  To begin with, it
  974. assumes all the symbols, their values and associated function
  975. definitions, and any data presently on the stack, are accessible.  Any
  976. objects that can be reached indirectly through other accessible objects
  977. are also accessible.
  978.  
  979.    When marking is finished, all objects still unmarked are garbage.  No
  980. matter what the Lisp program or the user does, it is impossible to refer
  981. to them, since there is no longer a way to reach them.  Their space
  982. might as well be reused, since no one will miss them.  The second
  983. ("sweep") phase of the garbage collector arranges to reuse them.
  984.  
  985.    The sweep phase puts unused cons cells onto a "free list" for future
  986. allocation; likewise for symbols and markers.  It compacts the
  987. accessible strings so they occupy fewer 8k blocks; then it frees the
  988. other 8k blocks.  Vectors, buffers, windows, and other large objects are
  989. individually allocated and freed using `malloc' and `free'.
  990.  
  991.      Common Lisp note: unlike other Lisps, Emacs Lisp does not call the
  992.      garbage collector when the free list is empty.  Instead, it simply
  993.      requests the operating system to allocate more storage, and
  994.      processing continues until `gc-cons-threshold' bytes have been
  995.      used.
  996.  
  997.      This means that you can make sure that the garbage collector will
  998.      not run during a certain portion of a Lisp program by calling the
  999.      garbage collector explicitly just before it (provided that portion
  1000.      of the program does not use so much space as to force a second
  1001.      garbage collection).
  1002.  
  1003.  - Command: garbage-collect
  1004.      This command runs a garbage collection, and returns information on
  1005.      the amount of space in use.  (Garbage collection can also occur
  1006.      spontaneously if you use more than `gc-cons-threshold' bytes of
  1007.      Lisp data since the previous garbage collection.)
  1008.  
  1009.      `garbage-collect' returns a list containing the following
  1010.      information:
  1011.  
  1012.           ((USED-CONSES . FREE-CONSES)
  1013.            (USED-SYMS . FREE-SYMS)
  1014.            (USED-MARKERS . FREE-MARKERS)
  1015.            USED-STRING-CHARS
  1016.            USED-VECTOR-SLOTS
  1017.            (PLIST))
  1018.           
  1019.           (garbage-collect)
  1020.                => ((7285 . 3680) (5462 . 0)
  1021.                      (47 . 1074) 135506 20902
  1022.                      (conses-used 7285 conses-free 3680 cons-storage 88064
  1023.                       symbols-used 5462 symbols-free 0 symbol-storage 133120
  1024.                       vectors-used 1005 vectors-total-length 20902
  1025.                       vector-storage 95668 bytecodes-used 508 bytecodes-free 30
  1026.                       bytecode-storage 16192 short-strings-used 3596
  1027.                       long-strings-used 0 strings-free 920
  1028.                       short-strings-total-length 135506 short-string-storage 163840
  1029.                       long-strings-total-length 0 string-header-storage 55296
  1030.                       floats-used 0 floats-free 9 float-storage 2044 markers-used 47
  1031.                       markers-free 1074 marker-storage 18360 events-used 104
  1032.                       events-free 21 event-storage 15840 extents-used 0
  1033.                       extents-free 17 extent-storage 2032 extent-duplicates-used 0
  1034.                       extent-duplicates-free 0 extent-duplicate-storage 0
  1035.                       processs-used 1 process-storage 80 frames-used 1
  1036.                       frame-storage 188 menubar-datas-used 1
  1037.                       menubar-data-storage 24 pixmaps-used 10 pixmap-storage 560
  1038.                       faces-used 44 face-storage 1232 pixels-used 14
  1039.                       pixel-storage 448 fonts-used 7 font-storage 280
  1040.                       tooltalk-patterns-used 23 tooltalk-pattern-storage 368
  1041.                       cursors-used 5 cursor-storage 160
  1042.                       buffer-local-value-cells-used 33
  1043.                       buffer-local-value-cell-storage 1056 keymaps-used 128
  1044.                       keymap-storage 5120 hashtables-used 256
  1045.                       hashtable-storage 9216 buffers-used 11 buffers-freed 1
  1046.                       buffer-storage 2640 output-streams-used 0
  1047.                       output-streams-freed 1 output-stream-storage 0 windows-used 4
  1048.                       windows-freed 12 window-storage 576
  1049.                       window-configurations-used 0 window-configurations-freed 22
  1050.                       window-configuration-storage 0))
  1051.  
  1052.      Here is a table explaining each element:
  1053.  
  1054.     USED-CONSES
  1055.           The number of cons cells in use.
  1056.  
  1057.     FREE-CONSES
  1058.           The number of cons cells for which space has been obtained
  1059.           from the operating system, but that are not currently being
  1060.           used.
  1061.  
  1062.     USED-SYMS
  1063.           The number of symbols in use.
  1064.  
  1065.     FREE-SYMS
  1066.           The number of symbols for which space has been obtained from
  1067.           the operating system, but that are not currently being used.
  1068.  
  1069.     USED-MARKERS
  1070.           The number of markers in use.
  1071.  
  1072.     FREE-MARKERS
  1073.           The number of markers for which space has been obtained from
  1074.           the operating system, but that are not currently being used.
  1075.  
  1076.     USED-STRING-CHARS
  1077.           The total size of all strings, in characters.
  1078.  
  1079.     USED-VECTOR-SLOTS
  1080.           The total number of elements of existing vectors.
  1081.  
  1082.     PLIST
  1083.           A list of alternating keyword/value pairs providing more
  1084.           detailed information. (As you can see above, quite a lot of
  1085.           information is provided.)
  1086.  
  1087.  - User Option: gc-cons-threshold
  1088.      The value of this variable is the number of bytes of storage that
  1089.      must be allocated for Lisp objects after one garbage collection in
  1090.      order to trigger another garbage collection.  A cons cell counts
  1091.      as eight bytes, a string as one byte per character plus a few
  1092.      bytes of overhead, and so on; space allocated to the contents of
  1093.      buffers does not count.  Note that the subsequent garbage
  1094.      collection does not happen immediately when the threshold is
  1095.      exhausted, but only the next time the Lisp evaluator is called.
  1096.  
  1097.      The initial threshold value is 300,000.  If you specify a larger
  1098.      value, garbage collection will happen less often.  This reduces the
  1099.      amount of time spent garbage collecting, but increases total
  1100.      memory use.  You may want to do this when running a program that
  1101.      creates lots of Lisp data.
  1102.  
  1103.      You can make collections more frequent by specifying a smaller
  1104.      value, down to 10,000.  A value less than 10,000 will remain in
  1105.      effect only until the subsequent garbage collection, at which time
  1106.      `garbage-collect' will set the threshold back to 10,000.
  1107.  
  1108.  - Function: memory-limit
  1109.      This function returns the address of the last byte XEmacs has
  1110.      allocated, divided by 1024.  We divide the value by 1024 to make
  1111.      sure it fits in a Lisp integer.
  1112.  
  1113.      You can use this to get a general idea of how your actions affect
  1114.      the memory usage.
  1115.  
  1116.